import { Prop, Schema, SchemaFactory } from '@nestjs/mongoose';
import { Document } from 'mongoose';
import { MusicList } from './musicList.schemas';
@Schema({ collection: 'Room' })
export class Room extends Document {
  @Prop({
    required: true,
  })
  room_name: string;

  @Prop({ required: true })
  school: string;

  @Prop({ required: false, default: [] })
  paylist: MusicList[];

  @Prop()
  clients: {
    random: string;
    user_name: string;
    status: string;
    host: boolean;
    socket_id: string;
  }[];

  @Prop()
  state: 'end' | 'play' | 'pause';
}
export const RoomSchema = SchemaFactory.createForClass(Room);
